﻿using PARK.Common.Const;
using SqlSugar;
using System;
using Yitter.IdGenerator;

namespace PARK.Attend.Entitys
{
    /// <summary>
    /// 考勤记录
    /// </summary>
    [SugarTable("attend_records")]
    [Tenant(ClaimConst.TENANT_ID)]
    public class AttendRecordEntity
    {
        /// <summary>
        /// 记录Id
        /// </summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
        public string Id { get; set; }        
        /// <summary>
        /// 门禁记录Id
        /// </summary>
        [SugarColumn(ColumnName = "accessreId")]        
        public string accessreId { get; set; }
        /// <summary>
        /// 日期类型 0休息1工作
        /// </summary>
        [SugarColumn(ColumnName = "worktype")]        
        public int worktype { get; set; }
        /// <summary>
        /// 打卡类型 1上班2下班
        /// </summary>
        [SugarColumn(ColumnName = "SignType")]
        public int SignType { get; set; }
        /// <summary>
        /// 打卡时间
        /// </summary>
        [SugarColumn(ColumnName = "SignTime")]
        public string SignTime { get; set; }
        /// <summary>
        /// 打卡状态 1正常  2迟到  3早退 
        /// </summary>
        [SugarColumn(ColumnName = "SignStatus")]
        public int SignStatus { get; set; }
        /// <summary>
        /// 早退、提前、加班时长_分钟
        /// </summary>
        [SugarColumn(ColumnName = "SignMint")]
        public int SignMint { get; set; }
        /// <summary>
        /// 设备id
        /// </summary>
        [SugarColumn(ColumnName = "ctlId")]        
        public string ctlId { get; set; }  
        /// <summary>
        /// 设备sn
        /// </summary>
        [SugarColumn(ColumnName = "ctlSn")]        
        public string ctlSn { get; set; }  
        /// <summary>
        /// 设备名称
        /// </summary>
        [SugarColumn(ColumnName = "ctlName")]        
        public string ctlName { get; set; }        
        /// <summary>
        /// 人员Id
        /// </summary>
        [SugarColumn(ColumnName = "EmployeeId")]        
        public string EmployeeId { get; set; }        
        /// <summary>
        /// 工号
        /// </summary>
        [SugarColumn(ColumnName = "JobNo")]        
        public string JobNo { get; set; }        
        /// <summary>
        /// 姓名
        /// </summary>
        [SugarColumn(ColumnName = "ReallName")]        
        public string ReallName { get; set; }
        /// <summary>
        /// 打卡卡号
        /// </summary>
        [SugarColumn(ColumnName = "CardNo")]
        public string CardNo { get; set; }
        
        /// <summary>
        /// 部门Id
        /// </summary>
        [SugarColumn(ColumnName = "DepartId")]        
        public string DepartId { get; set; }        
        /// <summary>
        /// 部门
        /// </summary>
        [SugarColumn(ColumnName = "DepartName")]        
        public string DepartName { get; set; }
        /// <summary>
        /// SortCode
        /// </summary>
        [SugarColumn(ColumnName = "SortCode")]
        public long? SortCode { get; set; }

        /// <summary>
        /// 所属公司Id
        /// </summary>
        [SugarColumn(ColumnName = "CompanyId")]
        public string CompanyId { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        [SugarColumn(ColumnName = "CompanyName")]
        public string CompanyName { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnName = "Description")]
        public string Description { get; set; }
        /// <summary>
        /// 数据来源 0打卡 1手工录入
        /// </summary>
        [SugarColumn(ColumnName = "DataSoure")]
        public int DataSoure { get; set; }

        /// <summary>
        /// 创建
        /// </summary>
        public virtual void Create()
        {
            this.Id = YitIdHelper.NextId().ToString();
        }
    }
}